﻿<Page x:Class="SsTool.Core.OrgPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="OrgPage">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
            <Button Content="添加" Name="_ctlBtnCreate" Click="_ctlBtnCreate_Click" />
        </StackPanel>
        <TreeView Grid.Row="1" Grid.Column="0" Name="_ctlTreeOrg" SelectedItemChanged="_ctlTreeOrg_SelectedItemChanged">
            <TreeView.Resources>
                <Style TargetType="TreeViewItem">
                    <Setter Property="IsExpanded" Value="True"/>
                </Style>
            </TreeView.Resources>
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
                    <TextBlock Text="{Binding Path=Caption}"/>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
        <DataGrid Grid.Row="1" Grid.Column="1" Name="_ctlGridMember" AutoGenerateColumns="False" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="姓名" Binding="{Binding Path=User.Name}" Width="*"/>
                <DataGridCheckBoxColumn Header="主要岗位" Binding="{Binding Path=IsMajor}"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>
